Skip to content

Did problems#12

Open
F00dDemon wants to merge 5 commits intogrc-cohort-22:mainfrom
F00dDemon:main
Open

Did problems#12
F00dDemon wants to merge 5 commits intogrc-cohort-22:mainfrom
F00dDemon:main

Conversation

@F00dDemon
Copy link
Copy Markdown

No description provided.

Comment thread src/Practice.java
Comment on lines +53 to +63
String shortWord = "dsajfoiewahjrog8jeraiobjfdaighjdaihgerwao8gherahgusahfoiueahgfdo98";
for (String string : words) {
if(string.length() < shortWord.length()){
shortWord = string;
}else if(string.length() == shortWord.length()){
int compare = shortWord.compareTo(string);
if(compare > 0){
shortWord = string;
}
}
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would happen if our shortest word was "bababadalgharaghtakamminarronnkonnbronntonnerronntuonnthunntrovarrhounawnskawntoohoohoordenenthurnuk" (the first 100-letter-long thunderword in the modernist classic "Finnegans Wake")? Can you think of how you could change your code to be more robust?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants